module dogre.resourcegroupmanager;

import std.string;
import dogre.internals.utils;

extern(C)
{
    void* call_ResourceGroupManager_getSingletonPtr();
    void call_initialiseAllResourceGroups(void* ptr);
	void call_addResourceLocation(void* ptr, const(char)* name, const(char)* locType,
                                  const(char)* resGroup, bool recursive);
}

class ResourceGroupManager
{
    mixin(Wrapper);
	~this(){ }
    
    static string DEFAULT_RESOURCE_GROUP_NAME = "General";
    static string INTERNAL_RESOURCE_GROUP_NAME = "Internal";
    static string AUTODETECT_RESOURCE_GROUP_NAME = "Autodetect";
	
    static ResourceGroupManager getSingleton()
    {
        return new ResourceGroupManager(call_ResourceGroupManager_getSingletonPtr());
    }
    void initialiseAllResourceGroups()
    {
        call_initialiseAllResourceGroups(p);
    }
    void addResourceLocation(string name, string locType, string resGroup = "", bool recursive = false)
    {
        call_addResourceLocation(p, toStringz(name),
                                    toStringz(locType),
                                    resGroup != "" ? toStringz(resGroup) : toStringz(DEFAULT_RESOURCE_GROUP_NAME),
                                    recursive);
    }
}
